
public class MEM_WB {
	int RegWE;
	int DestReg;
	int DestVal;
	int AccMem;
	
	int keep;
	
	int swRegSrc; 
	
	private int PC;
	
	void clear(){
		RegWE=0;
		DestReg=0;
		DestVal=0;
		AccMem=0;
		swRegSrc=0;
	}
	
	void init(){
		keep=0;
		PC=-4;
	}
	
	void set_RegWE(int regwe){
		if(keep==0)
			RegWE=regwe;
	}
	int get_RegWe(){
		return RegWE;
	}
	void set_DestReg(int destreg){
		if(keep==0)
			DestReg=destreg;
	}
	int get_DestReg(){
		return DestReg;
	}
	void set_DestVal(int destreg){
		if(keep==0)
			DestVal=destreg;
	}
	int get_DestVal(){
		return DestVal;
	}
	void set_AccMem(int accmem){
		AccMem=accmem;
	}
	int get_AccMem(){
		return AccMem;
	}
	void set_swRegSrc(int regwe){
		if(keep==0)
			swRegSrc=regwe;
	}
	int get_swRegSrc(){
		return swRegSrc;
	}
	
	void setPC(int pc){
		this.PC=pc;
	}
	
	int getPC(){
		return this.PC;
	}
}
